Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: space pkm response to max once per minute #2422

Merged
merged 5 commits into from
Jan 10, 2025

Conversation

iamKunalGupta
Copy link
Member

No description provided.

@iamKunalGupta iamKunalGupta requested a review from a team January 9, 2025 22:48
@@ -386,7 +386,8 @@ func PullCdcRecords[Items model.Items](

for {
if pkmRequiresResponse {
if cdcRecordsStorage.IsEmpty() && int64(clientXLogPos) > req.ConsumedOffset.Load() {
if cdcRecordsStorage.IsEmpty() && int64(clientXLogPos) > req.ConsumedOffset.Load() &&
time.Since(standByLastLogged) >= 1*time.Minute {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally we'd throttle this based on this update, not alongside existing logging code. Or move logging code in here & only log once a minute

As is we may be logging every 10s & never update offset

@iamKunalGupta iamKunalGupta force-pushed the fix/send-pkm-response-1-per-minute branch from 6415919 to 7755201 Compare January 9, 2025 23:30
@@ -383,7 +384,12 @@ func PullCdcRecords[Items model.Items](

pkmRequiresResponse := false
waitingForCommit := false

pkmEmptyBatchThrottleEnabled, err := peerdbenv.PeerDBPKMEmptyBatchThrottleEnabled(ctx, nil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pkmEmptyBatchThrottleEnabled, err := peerdbenv.PeerDBPKMEmptyBatchThrottleEnabled(ctx, nil)
pkmEmptyBatchThrottleEnabled, err := peerdbenv.PeerDBPKMEmptyBatchThrottleEnabled(ctx, req.Env)

@iamKunalGupta iamKunalGupta changed the title fix: space space pkm response to max once per minute fix: space pkm response to max once per minute Jan 10, 2025
@iamKunalGupta iamKunalGupta merged commit b0e3a05 into main Jan 10, 2025
9 checks passed
@iamKunalGupta iamKunalGupta deleted the fix/send-pkm-response-1-per-minute branch January 10, 2025 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants